

<%@page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>

<%@taglib prefix="jstl" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@taglib prefix="security"
	uri="http://www.springframework.org/security/tags"%>
<%@taglib prefix="display" uri="http://displaytag.sf.net"%>
<%@taglib prefix="acme" tagdir="/WEB-INF/tags"%>



<jstl:if test="${isAdministrator}">
	<form:form action="security/registration/administrator.do"
		modelAttribute="administratorForm">

		<acme:textbox code="security.username" path="username" />
		<acme:password code="security.password" path="password" />
		<acme:password code="security.RepeatPassword" path="repeatPassword" />
		<acme:textbox code="security.name" path="name" />
		<acme:textbox code="security.surname" path="surname" />
		<acme:textbox code="security.email" path="email" />

		<br>
		<form:checkbox path="acceptConditions" value="true" />
		<a href="<spring:message
				code="security.conditionsJSP" />"
			target="_blank"><spring:message code="security.acceptConditions" /></a>
		<br>
		<acme:submit code="security.registration.save" name="save" />
	</form:form>
</jstl:if>


<jstl:if test="${!isAdministrator}">
	<form:form action="security/registration/user.do"
		modelAttribute="userForm">

		<acme:textbox code="security.username" path="username" />
		<acme:password code="security.password" path="password" />
		<acme:password code="security.RepeatPassword" path="repeatPassword" />
		<acme:textbox code="security.name" path="name" />
		<acme:textbox code="security.surname" path="surname" />
		<acme:textbox code="security.email" path="email" />
		
		<form:label path="userGroup">
			<spring:message code="security.group.select" />:
		</form:label>
		<form:select id ="userGroups" path = "userGroup">
			<form:option value="0" label = "-----"/>
			<form:options items="${userGroups}" itemValue="id" itemLabel="name" />
		</form:select>
		<form:errors cssClass = "error" path="userGroup" />
		<br/>

		<br>
		<form:checkbox path="acceptConditions" value="true" />
		<a href="<spring:message
				code="security.conditionsJSP" />"
			target="_blank"><spring:message code="security.acceptConditions" /></a>
		<br>
		<acme:submit code="security.registration.save" name="save" />
	</form:form>
</jstl:if>

<acme:cancel code="security.registration.cancel" url="/welcome/index.do" />






